<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\index\controller;

use think\admin\Controller;


/**
 * Class Aboutus
 * @package app\index\controller
 */
class Member extends BaseController
{

    static public $limit = 10;
    public $current_nav = "member";
    public $table = "CmsMember";
    public $type_mapping = array(1=>"会员单位",2=>"理事单位",3=>"副会长单位",4=>"会长单位");

    public function index()
    {
        $this->title = "会员单位";
        $page = intval($this->request->get("page",1));
        $this->kw = $this->intro = $this->request->get("kw");
        $this->page = intval($this->request->get("page",1));
        $offset = ($page-1)*self::$limit;

        $map = array("is_deleted"=>"0");
        $query = $this->app->db->name($this->table)->where($map)
            ->whereLike("name","%".$this->kw."%");
        $list = $query->order("id desc")->limit($offset,self::$limit)->select();

        $total = $this->app->db->name($this->table)->where($map)
            ->whereLike("name","%".$this->kw."%")->count();
        $pager = $this->_format_page_info($total, self::$limit);
        $this->product = array(
            "list" => $list,
            "pager" => $pager,
        );

        $this->_get_nav_menus();
        $this->_system();
        $this->fetch();
    }

}